<?php
/**
 * Description of Byte
 *
 * @author chedim
 */
class oByte extends oClass
{
    private $value = null;
    public function  __construct($data)
    {
        if (!is_int($data))
        {
            $data = chr(substr($data, 0, 1));
        }

        if ($data > 255 || $data < 0) {
            throw new eOutOfRange();
        }
        $this->value = $data;
    }

    public function value() {
        return $this->value;
    }
    public function  __toString()
    {
        return "".(int)$this->value();
    }
}
?>
